const taskBookData = {
  state: {
    taskBookData: {},
    projectBudgetColumns: [],
    scrollTop: {},
    allLoadingFinished: false
  },
  mutations: {
    setTaskBookData: (state, data) => {
      state.taskBookData = data
      sessionStorage.setItem('taskBookData', JSON.stringify(data))
    },
    setProjectBudgetColumns: (state, data) => {
      state.projectBudgetColumns = data
    },
    setScrollTop: (state, data) => {
      state.scrollTop = data
    },
    setAllLoadingGinished: (state, data) => {
      state.allLoadingFinished = data
    },
  },
  actions: {
    clearEditStorage: ({commit}) => {
      commit('setTaskBookData', {})
      sessionStorage.removeItem('taskBookData')
      sessionStorage.removeItem('analysisTermTreeData')
      sessionStorage.removeItem('taskBookTagId')
      commit('setProjectBudgetColumns', [])
    }
  }
}
export default taskBookData